package com.mmall.product.api.dto;

import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

/**
 * @author hejianglong
 * @date 2019/10/24
 */
@Data
@Accessors(chain = true)
public class ProductDetailDTO implements Serializable {

    private final long serialVersionUID = 1L;

    @NotEmpty(message = "请填写名称")
    private String name;

    @Min(value = 1, message = "价格至少要大于 1 分钱")
    private Integer price;

    @NotEmpty(message = "必须上传图片")
    private String icon;

    @Min(value = 1, message = "库存数量必须大于0")
    private Integer quantity;
}
